<h3><?php __('Bộ lọc'); ?>:</h3>
<div style="margin-bottom:20px;">
    
    <form action="<?php echo $this->Html->url(array('action' => 'index')); ?>" method="POST" id="filter_box">
    
    <h4>
    <?php __('Tỉnh/Thành'); ?>:
    <select onchange="document.getElementById('filter_box').submit()" name="filter_city">
        <option value=""><?php __('Tất cả'); ?></option>
        <?php foreach($cities as $city) {
            $selected = "";
            if($city['City']['id'] == $city_id)
            {
                $selected = 'selected="selected"';
            }
        ?>
            <option value="<?php echo $city['City']['id'] ?>" <?php echo $selected; ?> ><?php echo $city['City']['name'] ?></option>
        <?php } ?>
    </select>
    </h4>
    
    <h4>
    <?php __('Năm'); ?>:
    <select  onchange="document.getElementById('filter_box').submit()" name="filter_year" id="filter_year">        
			    <?php for($i=1991; $i < 2031; $i++ ) {
				$selected = "";
				if($year == $i)
				{
				    $selected = 'selected="selected"';
				}
                                if(!$year) $year = 2011;
			    ?>
				<option value="<?php echo $i ?>" <?php echo $selected; ?> ><?php echo $i ?></option>
			    <?php } ?>
    </select>
    </h4>
    
    </form>
    
</div>

